<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateExamPaperQuestionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('exam_paper_questions', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('exam_paper_id')->comment("试卷id");
            $table->unsignedInteger('question_id')->comment("试题id");
            $table->string('name')->comment("名称");
            $table->text('question_stem')->comment("题干");
            $table->tinyInteger("question_type")->default(0)->comment("题型【单选|多选|判断|填空|简答】");
            $table->unsignedInteger('order')->comment("排序")->default(0)->nullable() ;
            $table->unsignedInteger('score')->comment("分数");
            $table->tinyInteger("is_required")->default(0)->comment("是否必填[否|是]");
            $table->tinyInteger("is_displayed")->default(1)->comment("是否显示[否|是]");
            $table->text('hint')->comment("提示")->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('exam_paper_questions');
    }
}
